package com.jhws.core.exception;

/**
 * 业务异常可抛
 *
 * @author xiaokek
 * @since 2015年11月2日 下午10:56:52
 */
public class BizException extends RuntimeException{
	public final String code;
	public final String msg;
	public final String type;
	
	public BizException(String msg){
		this("-1","error",msg);
	}
	
	public BizException(String code, String type,String msg){
		this.code = code;
		this.msg = msg;
		this.type = type;
	}
	
	public BizException(String code, String type,String msg, Throwable e){
		super(e);
		this.code = code;
		this.msg = msg;
		this.type = type;
	}

	@Override
	public String toString() {
		return "BizException [code=" + code + ", msg=" + msg + ", type=" + type + "]";
	}
}
